local duf = _G.DeclarativeUnitFrames

function duf.class_handlers:Frame(state, decl, add)
end

function duf.class_handlers:StatusBar(state, decl, add)
	if decl.min or decl.max then
		self:AddCallback(state, decl, add, "StatusBar_UpdateMinMax", function(state, decl, add)
			add("local min = %s", self:GetValue(state, decl, "min", 0, "StatusBar_UpdateMinMax"))
			add("local max = %s", self:GetValue(state, decl, "max", 100, "StatusBar_UpdateMinMax"))
			add("frame:SetMinMaxValues(min, max)")
		end)
		add("StatusBar_UpdateMinMax()")
	end
	if decl.value then
		self:AddCallback(state, decl, add, "StatusBar_UpdateValue", function(state, decl, add)
			add("local value = %s", self:GetValue(state, decl, "value", 0, "StatusBar_UpdateValue"))
			add("frame:SetValue(value)")
		end)
		add("StatusBar_UpdateValue()")
	end
	if decl.texture then
		self:AddCallback(state, decl, add, "StatusBar_SetStatusBarTexture", function(state, decl, add)
			add("local value = %s", self:GetValue(state, decl, "texture", 0, "StatusBar_SetStatusBarTexture"))
			add("frame:SetStatusBarTexture(value)")
		end)
		add("StatusBar_SetStatusBarTexture()")
	end
	if decl.color then
		self:AddCallback(state, decl, add, "StatusBar_SetStatusBarColor", function(state, decl, add)
			add("local value = %s", self:GetValue(state, decl, "color", 0, "StatusBar_SetStatusBarColor"))
			add("frame:SetStatusBarColor(GetColor(value))")
		end)
		add("StatusBar_SetStatusBarColor()")
		self:RegisterUtil(state, "GetColor")
	end
end

